Add option to 'discard' filter to toss points with no or unknown fix.
authorrobertl <robertl>
Tue, 17 Jun 2008 17:17:11 +0000 (17:17 +0000)
committerrobertl <robertl>
Tue, 17 Jun 2008 17:17:11 +0000 (17:17 +0000)
discard.c
xmldoc/filters/options/discard-fixnone.xml [new file with mode: 0644]
xmldoc/filters/options/discard-fixunknown.xml [new file with mode: 0644]

index 0a8d29e4d3fda902ea0d4411637ee89033e47e64..fbb00f156b727e7eaf6ae62c09d97d577cdd989e 100644 (file)
--- a/discard.c
+++ b/discard.c
@@ -27,6 +27,8 @@ static char *hdopopt = NULL;
 static char *vdopopt = NULL;
 static char *andopt = NULL;
 static char *satopt = NULL;
+static char *fixnoneopt = NULL;
+static char *fixunknownopt = NULL;
 static double hdopf;
 static double vdopf;
 static int satpf;
@@ -43,6 +45,10 @@ arglist_t fix_args[] = {
                NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
        {"sat", &satopt, "Minimium sats to keep waypoints",
                "-1.0", ARGTYPE_BEGIN_REQ | ARGTYPE_INT, ARG_NOMINMAX},
+       {"fixnone", &fixnoneopt, "Suppress waypoints without fix",
+               NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
+       {"fixunknown", &fixunknownopt, "Suppress waypoints with unknown fix",
+               NULL, ARGTYPE_BOOL, ARG_NOMINMAX},
        ARG_TERMINATOR
 };
 
@@ -71,6 +77,12 @@ fix_process_wpt(const waypoint *wpt)
         if ((satpf >= 0) && (waypointp->sat < satpf))
                del = 1;
 
+       if ((fixnoneopt) && (waypointp->fix == fix_none))
+               del = 1;
+
+       if ((fixunknownopt) && (waypointp->fix == fix_unknown))
+               del = 1;
+
        if (del) {
                switch(what) {
                        case wptdata:
diff --git a/xmldoc/filters/options/discard-fixnone.xml b/xmldoc/filters/options/discard-fixnone.xml
new file mode 100644 (file)
index 0000000..b7b8493
--- /dev/null
@@ -0,0 +1,5 @@
+<para>
+  This option is similar to the 'sat' option, but there are times when
+  some GPSes will know how many satellites are in view, but not yet computed
+  a valid fix.  This option allows you to discard those points.
+</para>
diff --git a/xmldoc/filters/options/discard-fixunknown.xml b/xmldoc/filters/options/discard-fixunknown.xml
new file mode 100644 (file)
index 0000000..0063829
--- /dev/null
@@ -0,0 +1,5 @@
+<para>
+  This option is similar to the 'sat' option, but some GPSes will log
+  points with a fix value of 'unknown'.
+  This option allows you to discard those points.
+</para>